//index.js
//获取应用实例
const app = getApp();
import {
  SERVERS_INFO,
  SERVERS_ALIAS
} from '../../utils/api.js'

import {
  http
} from '../../utils/network.js'
import {
  PATHS_ALIAS
} from '../../utils/api.js'

Page({
  data: {
    
  },
  onLoad: function() {
    // 判断微信版本
    this.checkVersion();
  },
  // 显示模态对话框 ———— 版本过低提示
  checkVersion: function() {
    let _this = this;
    wx.getSystemInfo({
      success: function(res) {
        // console.log(res);
        let version = res.SDKVersion;
        version = version.replace(/\./g, '');
        if (parseInt(version) < 167) { //小于 1.6.7的版本
          wx.showModal({
            title: '提示',
            content: '微信版本过低，请前往升级微信',
            showCancel: false,
            success: function(res) {
              // console.log(res)
              if (res.confirm) {
                _this.openModal()
              }
            }
          })
          return;
        }
      }
    });
  },
  // 二次授权
  loginAgain:function(){
    this.selectComponent('#loginCheck').loginAgain();
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function (e) {

  }
})